/**
 * @dataSource 参照城市表格数据
 * @referenceCityList 参照城市下拉选择列表
 * @selectionTableList 已勾选表格row集合
 * @purchasePriceType 进价类别，1为统一进价 2为区域进价
 * @defaultReferenceCityList 当页面为统一进价时，默认参照城市设置的选择集合
*/
const state = {
  dataSource: [],
  referenceCityList: [],
  selectionTableList: [],
  purchasePriceType: '',
  defaultReferenceCityList: [],
  // 历史参照数据
  historyCityList: [],
}
const mutations = {
  /* 设置参照城市表格数据 */
  SET_TABLE_DATA: (state, data) => {
    state.dataSource = data
  },
  /* 设置参照城市表格历史数据 */
  SET_HISTORY_CITY_DATA: (state, data) => {
    state.historyCityList = data
  },
  /* 设置参照城市列表 */
  SET_REFERENCE_CITIES: (state, data) => {
    state.referenceCityList = data
  },
  /* 设置已勾选表格数据 */
  SET_SELECTED_ITEM: (state, data) => {
    state.selectionTableList = data
  },
  /* 设置进价类别 */
  SET_PURCHASE_PRICETYPE: (state, data) => {
    state.purchasePriceType = data
  },
  /* 设置默认参照城市列表 */
  SET_DEFAULT_REFERENCE_CITIES: (state, data) => {
    state.defaultReferenceCityList = data
  },
  /* 所有state状态都清空 */
  DESTORY_STATE: (state, data) => {
    state.dataSource = []
    state.referenceCityList = []
    state.selectionTableList = []
    state.purchasePriceType = ''
    state.defaultReferenceCityList = []
  }
}
export default {
  namespaced: true,
  state,
  mutations
}
